package com.ecommerce.user.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.LocalDateTime;

/**
 * 用户详情实体
 */
@Entity
@Table(name = "t_user_profile")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserProfile {

    /**
     * 用户ID
     */
    @Id
    private Long userId;

    /**
     * 真实姓名
     */
    @Column(length = 50)
    private String realName;

    /**
     * 身份证号
     */
    @Column(length = 20)
    private String idCard;

    /**
     * 地址
     */
    @Column(length = 200)
    private String address;

    /**
     * 职业
     */
    @Column(length = 50)
    private String occupation;

    /**
     * 个人简介
     */
    @Column(length = 500)
    private String bio;

    /**
     * 兴趣标签（JSON格式）
     */
    @Column(length = 1000)
    private String interests;

    /**
     * 创建时间
     */
    @Column(nullable = false, updatable = false)
    @CreationTimestamp
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column(nullable = false)
    @UpdateTimestamp
    private LocalDateTime updateTime;
}